package com.authine.cloudpivot.ext.constants;


import java.math.BigDecimal;
import java.util.*;

public final class PlatformConst {
    /**
     * 登录信息
     */
    public final static String corpLoginId = "2c9ac2dc7cc0c9e7017d09932db6006a";
    public final static String loginId = "2c9ac2dc7cc0c9e7017d09932db50069";
    public final static String loginName = "fengjie";

    /**
     * 管理员角色
     */
    public final static String ROLE_PM_ADMIN = "ROLE_PM_ADMIN";
    public final static String ROLE_VENDOR_ADMIN = "ROLE_VENDOR_ADMIN";
    public final static String ROLE_CUSTOMER_ADMIN = "ROLE_CUSTOMER_ADMIN";

    /**
     * 角色类型
     */
    public final static String VENDOR_ROLE = "VENDOR";
    public final static String CUSTOMER_ROLE = "CUSTOMER";

    /**
     * 驻场角色
     */
    public final static String ROLE_PM_ZC = "ROLE_PM_ZC";
    public final static String ROLE_CUSTOMER_ZC = "ROLE_CUSTOMER_ZC";

    /**
     * 默认的组织
     */
    public final static String ORGANIZATION_ID = "1";
    public final static String ORGANIZATION_NAME = "上海固买供应链管理有限公司";
    /**
     * 平台结算账户ID
     */
    public final static String ORGANIZATION_ACCOUND_ID = "1";
    public final static BigDecimal PLATRATE = new BigDecimal("0.03");
    /**
     * 订单售后状态 售后状态（未售后、售后中、已售后）
     */
    public final static String NOT_AFTER_SALE = "未售后";
    public final static String AFTER_SALES = "售后中";
    public final static String DONE_AFTER_SALE = "已售后";

    /**
     * 南阳税号
     */
    public static final String NYTAXNUM = "91411325MA9G9M0K0T";

    /**
     * 上海税号
     */
    public static final String SHTAXNUM = "91310118086192508M";

    /**
     * 服务费发票税率
     */
    public final static BigDecimal PLATTAXRATE = new BigDecimal("0.06");
    public final static String MEMBERID = "1";
    public final static String INTEREST_CHANGE_POINT = "2020-3-13 00:00:00";
    public final static String SERVICE_INVOICE_NAME = "服务费";
    public final static String SERVICE_INVOICE_GOLDEN_TAX = "3040201990000000000";
    public final static List<String> GOLDEN_TAX_OIL = Arrays.asList("1070101030400000000", "1070101040100000000", "1070101040200000000", "1070101040300000000", "1070101050100000000", "1070101050200000000", "1070101050300000000", "1070101060100000000", "1070101070100000000", "1070101070200000000");

    public final static String ROLE_CUSTOMER_COMPANY_REGION = "ROLE_CUSTOMER_COMPANY_REGION";

    //平台组织ID集合
    public final static List<String> PLATFORM_ORGANIZATION_IDS;
    //平台账户ID集合
    public final static List<String> ORGANIZATION_ACCOUND_IDS;
    //平台名称集合
    public final static Map<String, String> PLATFORM_ORGANIZATIONS;
    //平台开票信息集合
    public final static Map<Long, String> PLATFORM_ORGANIZATIONS_INVOICE_INFO;

    static {
        //不要调整值的顺序
        PLATFORM_ORGANIZATION_IDS = new ArrayList<>();
        PLATFORM_ORGANIZATION_IDS.add("1");
        PLATFORM_ORGANIZATION_IDS.add("2");

        PLATFORM_ORGANIZATIONS = new HashMap<>();
        PLATFORM_ORGANIZATIONS.put("1", "上海固买供应链管理有限公司");
        PLATFORM_ORGANIZATIONS.put("2", "固买供应链管理南阳有限公司");

        ORGANIZATION_ACCOUND_IDS = new ArrayList<>();
        ORGANIZATION_ACCOUND_IDS.add("1");

        PLATFORM_ORGANIZATIONS_INVOICE_INFO = new HashMap<>();
        PLATFORM_ORGANIZATIONS_INVOICE_INFO.put(1L, "上海固买供应链管理有限公司");
        PLATFORM_ORGANIZATIONS_INVOICE_INFO.put(2L, "固买供应链管理南阳有限公司");
    }

    public static String getPlatformOrganizationName(String purchaseOrganizationId, String saleOrganizationId) {
        if (PlatformConst.PLATFORM_ORGANIZATION_IDS.get(1).equals(purchaseOrganizationId)
                || PlatformConst.PLATFORM_ORGANIZATION_IDS.get(1).equals(saleOrganizationId)) {
            return PLATFORM_ORGANIZATIONS.get("2");
        } else {
            return PLATFORM_ORGANIZATIONS.get("1");
        }
    }

    //振德相关组织名称
    public final static List<String> ZHENDE_ORGANIZATION_NAMES;

    static {
        ZHENDE_ORGANIZATION_NAMES = new ArrayList<>();
        ZHENDE_ORGANIZATION_NAMES.add("河南振德医疗用品有限公司");
        ZHENDE_ORGANIZATION_NAMES.add("许昌振德医用敷料有限公司");
        ZHENDE_ORGANIZATION_NAMES.add("振德医疗用品股份有限公司");
        ZHENDE_ORGANIZATION_NAMES.add("许昌正德医疗用品有限公司");
        ZHENDE_ORGANIZATION_NAMES.add("绍兴好士德医疗用品有限公司");
    }

}
